﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Yu.Cms.Web.UserCtrl.Default
{
    public partial class Slide : BaseCtrl
    {
        private string configPath = Config.AggregationFileManager.ConfigFilePath;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.OnStar();
            }
        }
        protected void OnStar()
        {
            XmlSlideSource.DataFile = configPath;
            this.BindPic();
            this.BindList();
        }

        /// <summary>
        /// 绑定数据源
        /// </summary>
        protected void BindPic()
        {
            XmlSlideSource.XPath = "/AggregationInfo/Website_RotatePiclist/RotatePic";
            RptPic.DataSource = XmlSlideSource;
            RptPic.DataBind();
        }

        /// <summary>
        /// 绑定
        /// </summary>
        protected void BindList()
        {
            XmlSlideSource.XPath = "/AggregationInfo/Website_RotatePiclist/RotatePic";
            RptList.DataSource = XmlSlideSource; 
            RptList.DataBind();
        }
    }
}